<%
layout("/include/_container.html", {title:"定时任务", parent:"系统监控"}){
%>
<!-- 搜索 -->
<div id="search-collapse" class="white-box collapse m-b-5">
    <a class="jp-ti-close close"
       onclick="$('#search-collapse').fadeToggle()">
        <i class="fa fa-times"></i>
    </a>
    <form id="searchForm" class="form-inline">
        <div class="form-group m-b-10 m-r-10">
            <label class="m-r-10" title="任务名：">任务名：</label>
            <input name="name" maxlength="64" class=" form-control"/>
        </div>
        <div class="form-group m-b-10 m-r-10">
            <a  id="search" class="btn btn-custom waves-effect waves-light m-l-10 btn-md btn-rounded"><i class="fa fa-search"></i> 查询</a>
            <a  id="reset" class="btn btn-custom waves-effect waves-light m-l-10 btn-md btn-rounded" ><i class="fa fa-refresh"></i> 重置</a>
        </div>
    </form>
</div>

<div class="white-box">
    <!-- 工具栏 -->
    <div id="toolbar">
        <% if(shiro.hasPermission("monitor:scheduleJob:add")){ %>
        <a id="add" class="btn btn-custom waves-effect w-xs waves-light" href="${ctx}/monitor/scheduleJob/form" title="定时任务"><i
                class="fa fa-plus"></i> 新建</a>
        <% } %>
        <% if(shiro.hasPermission("monitor:scheduleJob:edit")){ %>
        <button id="edit" class="btn btn-white waves-effect w-xs waves-light" disabled onclick="edit()">
            <i class="fa fa-edit"></i> 修改
        </button>
        <% } %>
        <% if(shiro.hasPermission("monitor:scheduleJob:del")){ %>
        <button id="remove" class="btn btn-white waves-effect w-xs waves-light" disabled onclick="deleteAll()">
            <i class="fa fa-remove"></i> 删除
        </button>
        <% } %>
        <% if(shiro.hasPermission("monitor:scheduleJob:stop")){ %>
        <button id="stop" class="btn btn-white waves-effect w-xs waves-ligh" disabled onclick="stop()">
            <i class="glyphicon"></i> 暂停
        </button>
        <% } %>
        <% if(shiro.hasPermission("monitor:scheduleJob:resume")){ %>
        <button id="resume" class="btn btn-white waves-effect w-xs waves-ligh" disabled onclick="resume()">
            <i class="glyphicon"></i> 启动
        </button>
        <% } %>
        <% if(shiro.hasPermission("monitor:scheduleJob:startNow")){ %>
        <button id="startNow" class="btn btn-white waves-effect w-xs waves-ligh" disabled onclick="startNow()">
            <i class="glyphicon"></i> 立即运行一次
        </button>
        <% } %>
    </div>

    <!-- 表格 -->
    <table id="table" data-toolbar="#toolbar"/>

</div>
<% include("scheduleJobList.js"){} %>
<% } %>